package com.baiqian.doupo.douji;

import com.baiqian.doupo.capability.douqi.IDouQiCapability;
import com.baiqian.doupo.entity.DouJiShiShanLieEntity;
import com.baiqian.doupo.entity.EntityTypeRegistry;
import net.minecraft.entity.LivingEntity;
import net.minecraft.entity.player.PlayerEntity;

public class DouJi_ShiShanLie extends DouJi{
    DouJiShiShanLieEntity entity;
    public DouJi_ShiShanLie(){
        super("狮山裂", 1,3,1,2*20,7*20,
                2,0.7,0.0,0.0,1,1,true,true);
    }

    @Override
    public void useEx(IDouQiCapability l, PlayerEntity entity) {

    }

    @Override
    public void addEffect(LivingEntity entity) {

    }

    @Override
    protected void createEntity(IDouQiCapability l,PlayerEntity playerEntity){
        entity = EntityTypeRegistry.doujiShiShanLieEntity.get().create(playerEntity.world);
        entity.setShooter(playerEntity);
        entity.setLocationAndAngles(
                playerEntity.getPosX()+1*Math.sin(-Math.toRadians(playerEntity.rotationYaw)),
                playerEntity.getPosYEye()-1+1*Math.sin(-Math.toRadians(playerEntity.rotationPitch)),
                playerEntity.getPosZ()+1*Math.cos(-Math.toRadians(playerEntity.rotationYaw)),
                playerEntity.rotationYaw, playerEntity.rotationPitch);
        //设置实体造成的伤害
        entity.setDamage((float) (douqi_be_use*douji_attack_num));
        playerEntity.world.addEntity(entity);
    }
}
